<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
     <meta content="telephone=no" name="format-detection" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable = no"/>
    <title>登陆-{$webseting.web_title}</title>
    <link href="__PUBLIC__/wap/css/rest.css"  rel="stylesheet">
    <link href="__PUBLIC__/wap/css/lrstyle.css"  rel="stylesheet">
</head>
<body>

    <header id="header" class="u-header clearfix">
        <div class="u-hd-left f-left">
            <a href="{:U('wap/index/index')}" class="J_backToPrev"><span class="u-icon-px i-hd-back"></span></a>
        </div>
        <div class="u-hd-tit"><span>登陆{$webseting.web_title}</span></div>
        <div class="rightBox">
            <a id="register_btn" href="{:U('Wap/Login/register')}" class="right rbtn">
                注册
            </a>
        </div>
    </header>
    <div class="touchweb_page-login">
         <form action="" role="form" id="form2" novalidate="novalidate" method="post" onSubmit="return false;">
        <div class="login_box">
            <div class="form_item">
               <!--  <label class="icon-my" for="mobile" style="font-size: 1.6rem;"></label> -->
                 <label >
                    <img src="__PUBLIC__/wap/img/lmy.png" />
                </label>
                <div class="input_box">
                    <input type="text" id="mobile" name="mobile" value="{$mobile}" placeholder="手机号/会员号">
                    <span class="icon_delete icon-delete"></span>
                </div>
            </div>
            <div class="form_item">
              <!--   <label class="icon-password" for="mem_password" style="font-size: 1.6rem;"></label> -->
                <label >
                    <img src="__PUBLIC__/wap/img/ls.png" />
                </label>
                <div class="input_box">
                    <input type="password" id="mem_password" name="mem_password" placeholder="请输入密码">
                    <span class="icon_delete icon-delete"></span>
                </div>
            </div>
        </div>
        <div class="remember_login">
            <input id="touchweb_form-checkbox" name="rember" type="checkbox" value="1" checked="">
            <label for="touchweb_form-checkbox">两周内记住登录</label>
            <a href="{:U('wap/login/findpwd')}" class="forgot_password">忘记密码？</a>
        </div>

        <div class="agreement" style="display: none;">
            <label>点击登录，表示您同意FG峰购<a href="{:U('wap/Login/fuwu')}" class="license-terms">《服务协议》</a></label>
        </div>

        <div class="login_btn">
            <a id="login-btn" href="javascript: void(0);" class="btn phone_log_btn">登录</a>
        </div>
        </form>

     <!--    <div class="joint_login">
         <h2><span>合作账号登录</span></h2>
         <ul>
             <li style="width: 33.33%;">
                 <a href="javascript: void(0);" class="icon-alipay"></a>
             </li>
             <li style="width: 33.33%;">
                 <a href="javascript: void(0);" class="icon-weibo"></a>
             </li>
             <li style="width: 33.33%;">
                 <a href="javascript: void(0);" class="icon-qq"></a>
             </li>
         </ul>
     </div> -->
    </div>
     <script type="text/javascript" src="__PUBLIC__/wap/js/jquery.min.js"></script>

    <!--<script src="__PUBLIC__/bootstrap/vendor/jquery-validation/jquery.validate.min.js"></script>-->
    <script src="__PUBLIC__/bootstrap/vendor/jquery-validation/jquery.validate.wap.js"></script>
     <script src="__PUBLIC__/js/jquery.form.js"></script>
     <script type="text/javascript" src="__PUBLIC__/layer/layer.js"></script>
       <!--start 红包弹窗-->
   <include file="Public/hongbao" />
    <!--end 红包弹窗-->    
        <script>
jQuery(document).ready(function() {
                //FormValidator.init();
jQuery.validator.addMethod("byteRangeLength", function(value) {
    var dropdown=$("#dropdown").val();
    var ret=true;
    if(dropdown>0){
       if(!value){
        ret=false;
       }
    }
  return ret;   
});

$("#form2").validate({
  rules: {
   mobile: {
    required:true,
    remote: {
            url: "{:U('Wap/Login/cheack_account')}",
            type: "get",
            dataType: "json",
            data: {
                mobile: function () {
                    return $("#mobile").val();　　　　//这个是取要验证的数据
                }
            },
            dataFilter: function (msg) {　　　　//判断控制器返回的内容
                if (msg == "0") {
                    return false;
                }else {
                    return true;
                }
            }
        }
   },
   mem_password: {
                    required: true,
                    rangelength: [6, 20]
                }
  },
  messages: {
       mobile:{
        required:'<span class="icon-warning icon_warning"></span>&nbsp;请输入邮箱/手机/用户名',
        remote:'<span class="icon-warning icon_warning"></span>&nbsp;邮箱/手机/用户名不存在'
       },
       mem_password: {
        required:'<span class="icon-warning icon_warning"></span>&nbsp;请输入密码',
        rangelength:'<span class="icon-warning icon_warning"></span>&nbsp;密码请保持6-20位'
       }
  },
   focusInvalid:false,
  success: function(label) { 
            // set  as text for IE 
           // alert('ok'); 
            //label.html(" ").addClass("checked"); 
        }, 
        /*执行ajaxsubmit  */ 
        submitHandler: function(editform) { 

            var options = { 
                url :  "<?php echo U('Wap/Login/dologin'); ?>", 
                type : "post" , 
                dataType:'json', 
                target : "#loader", 
                error: function(){layer.msg("服务器没有返回数据，可能服务器忙，请重试",{icon:5});}, 
                onwait : "正在处理信息，请稍候...",
                success: function(response){ 
                       console.log(response);
                    //$("#loader").fadeIn(500).html(response.data).fadeOut(500); 
                    //$('#editform').hide(2000); 
                    if(response.status==1){
                       // alert("登录成功");
                       window.location.href=response.return_url; 
                    }else{

                        layer.msg(response.error, {icon: 5}); 
                        //alert(response.error);
                    }
                }
            };
            setTimeout((function(opt){
                return function(){
                    $('#form2').ajaxSubmit(opt);
                }
            })(options), 300); 
            return false; 
        }

  });

$('.phone_log_btn').click(function(){
    $('#form2').submit();
});
});

        </script>  

     
</body>
</html>